<template>
  <div id="app">
    <header class="head">
      <a class="back tl" href="javascript:history.back(-1)">
        <i class="el-icon-arrow-left"></i>
      </a>
      <a href="javascript:;" class="tc">
        <small class="font_18 co_f">土地档案详情</small>
      </a>
    </header>
    <main>
      <section class="detail_status_info">
        <header><span>基本信息</span></header>
        <p><label>详细坐落地址：</label><span>{{this.listData.fld_23}}</span></p>
        <p><label>所属部门(分公司)：</label><span>{{this.listData.fld_7}}</span></p>
        <p><label>权证编码：</label><span>{{this.listData.fld_12}}</span> </p>
        <p><label>土地证权属单位:</label><span>{{this.listData.fld_14}}</span> </p>
        <p><label>土地面积(m²)：</label><span>{{this.listData.fld_11}}</span> </p>
        <p><label>查看房产档案：</label>
          <span>
          <ul class="relation">
            <li v-for="item in newitems">
                <router-link :to='{name:"HouseArchivesdetail",query:{unid:item.unid}}'>
                    <img src="../../../img/house.png"  class="houseimg"/>{{item.name}}
                </router-link>
            </li>
          </ul>
          </span>
        </p>
      </section>
    </main>
  </div>
</template>


<script>
  import {
    ViewDetail
  } from '../../../api/api';
  export default {
    data() {
      return {
        listData:{},
        newitems:[]
      }; 
    },
    methods:{
      getData() {
        let options = {
          params: {
            unid:this.$route.query.unid
          }
        }
        //调取接口
        ViewDetail(options).then((res) =>{
          this.listData=res.fields
          this.items=res.fields.fld_4200.split('、')
          for(let i=0;i<this.items.length;i++){
            this.name=this.items[i].split("|")[0];
            this.unid=(this.items[i].split("|")[1]).split(".")[0];
            this.newitems.push({name:this.name,unid:this.unid})
          }
        })
      }
    },
    mounted(){
      this.getData();
    }
  }
</script>



<!-- Add "scoped" attribute to limit CSS to this component only -->

<style lang="scss" scoped>
  
  
</style>
